home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 August / Chip_2004-08_cd1.bin / software / slunec / app / 7855_10017.exe / scripts / DefineButton2_36 / BUTTONCONDACTION on(release).as
Encoding:
Text File  |  2004-06-17  |  1.7 KB  |  58 lines

  1. on(release){
  2.    if(_parent.PlayingGame)
  3.    {
  4.       if(_parent.CurrentFlipsCount < 999)
  5.       {
  6.          if(!CardMotion.out)
  7.          {
  8.             _parent.CurrentFlipsCount = _parent.CurrentFlipsCount + 1;
  9.             _parent.CurrentFlips = "Flips: " add _parent.CurrentFlipsCount;
  10.             if(_parent.NoOfCardsOut == 0)
  11.             {
  12.                tellTarget("CardMotion")
  13.                {
  14.                   gotoAndStop("SpinFront");
  15.                   play();
  16.                }
  17.                _parent.NoOfCardsOut = 1;
  18.                _parent.FirstCard = _parent.cardArray[ThisCardNumber - 1];
  19.                _parent.FirstCardName = this._name;
  20.             }
  21.             else if(_parent.NoOfCardsOut == 1)
  22.             {
  23.                tellTarget("CardMotion")
  24.                {
  25.                   gotoAndStop("SpinFront");
  26.                   play();
  27.                }
  28.                _parent.NoOfCardsOut = 2;
  29.                _parent.SecondCard = _parent.cardArray[ThisCardNumber - 1];
  30.                _parent.SecondCardName = this._name;
  31.                if(_parent.CurrentPairsCount == 11)
  32.                {
  33.                   gotoAndPlay(30);
  34.                }
  35.                else
  36.                {
  37.                   gotoAndPlay(2);
  38.                }
  39.             }
  40.             else if(_parent.NoOfCardsOut == 2)
  41.             {
  42.                tellTarget("_parent." add _parent.SecondCardName)
  43.                {
  44.                   gotoAndStop("DoNothing");
  45.                }
  46.                _parent.NoOfCardsOut = 3;
  47.                gotoAndPlay(30);
  48.             }
  49.          }
  50.       }
  51.       else
  52.       {
  53.          _parent.GameOverPage = "ExcessFlips";
  54.          _parent.gotoAndStop("GameOver");
  55.       }
  56.    }
  57. }
  58.